# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor:  hydro <hydro@freenet.de>

pkgname=libmediainfo
pkgver=23.10
pkgrel=1
pkgdesc='Shared library for MediaInfo'
arch=('loong64' 'x86_64')
url='https://mediaarea.net'
license=('BSD')
depends=(
  'glibc'
  'gcc-libs'
  'curl'
  'glib2'
  'libmms'
  'libzen'
  'tinyxml2'
  'graphviz'
  'zlib'
)
source=("$pkgname-$pkgver.tar.xz::https://mediaarea.net/download/source/libmediainfo/$pkgver/libmediainfo_$pkgver.tar.xz")
sha512sums=('fc7f6b4ff811e9656bfd795325511d53def3e78016a005cfd3439af955a3a6c13ef06dd72dd0685441e2419ed7d141bf762394f8b3d8a9bd00ad2780dc4acbb6')
b2sums=('e64481694c651b16bf72e18d5e68069f63efc481b465b6eb7d1d6a8c3e7de84aaabbc212fce8d734f7dd6d082a6ffcf1cdf040f410fd16554bf20db5460c3db4')

build() {
  cd MediaInfoLib/Project/GNU/Library

  ./autogen.sh

  ./configure \
    --prefix=/usr \
    --enable-shared \
    --disable-static \
    --with-libcurl \
    --with-libmms \
    --with-libtinyxml2 \
    --with-graphviz

  make
}

package() {
  cd MediaInfoLib/Project/GNU/Library

  make DESTDIR="$pkgdir" install

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" "$srcdir/MediaInfoLib/LICENSE"
}
